<template>
  <div>
    <div class="success">
      <el-avatar :size="150" :src="avatar" ></el-avatar>
      <span class="tip">扫描成功</span>
      <p class="login-mobile-click">请在手机{{productName}}IM中点击登录</p>
      <p class="switch-accout" @click="switchAccout">切换账号</p>
    </div>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  name: 'ScanSuccess',
  data () {
    return {
      circleUrl: 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png',
      loding: false
    }
  },
  computed: {
    ...mapState('app', ['successDataInfo']),
    ...mapState({
      productName: state => state.settings.productName,
      version: state => state.settings.version
    }),
    avatar: function () {
      return (this.successDataInfo.data && this.successDataInfo.data.avatar) || this.circleUrl
    }

  },
  created () {
    this.loding = JSON.parse(sessionStorage.getItem('aillo_loding'))
  },
  methods: {
    switchAccout () {
      this.$emit('onChangeLodeStatus', 2)
      sessionStorage.clear()
    }
  }
}
</script>

<style lang="scss" scoped>
.success {
  width: 297px;
  height: 401px;
  background: rgba(255, 255, 255, 1);
  border-radius: 9px;
  margin: auto;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  .avatar {
    width: 158px;
    height: 158px;
    border-radius: 300px;
  }
  .tip {
    margin-top: 39px;
    color: #3478f5;
    font-weight: 500;
    font-size: 19px;
  }
  .login-mobile-click {
    font-size: 19px;
    font-family: Source Han Sans CN;
    font-weight: 400;
    color: rgba(153, 153, 153, 1);
    margin-top: 19px;
  }
  .switch-accout {
    font-size: 17px;
    font-family: Source Han Sans CN;
    font-weight: 400;
    color: rgba(52, 120, 246, 1);
    margin-top: 20px;
    cursor: pointer;
  }
}
</style>
